home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 August / MW 8 2003 CD1.iso / Inside Macworld / Product News / gimp-1.2.4.sit / gimp-1.2.4 / app / undo_cmds.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-11-04  |  3.0 KB  |  118 lines

  1. /* The GIMP -- an image manipulation program
  2.  * Copyright (C) 1995-2000 Spencer Kimball and Peter Mattis
  3.  *
  4.  * This program is free software; you can redistribute it and/or modify
  5.  * it under the terms of the GNU General Public License as published by
  6.  * the Free Software Foundation; either version 2 of the License, or
  7.  * (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  */
  18.  
  19. /* NOTE: This file is autogenerated by pdbgen.pl. */
  20.  
  21. #include "config.h"
  22.  
  23. #include "procedural_db.h"
  24.  
  25. #include "undo.h"
  26.  
  27. static ProcRecord undo_push_group_start_proc;
  28. static ProcRecord undo_push_group_end_proc;
  29.  
  30. void
  31. register_undo_procs (void)
  32. {
  33.   procedural_db_register (&undo_push_group_start_proc);
  34.   procedural_db_register (&undo_push_group_end_proc);
  35. }
  36.  
  37. static Argument *
  38. undo_push_group_start_invoker (Argument *args)
  39. {
  40.   gboolean success = TRUE;
  41.   GimpImage *gimage;
  42.  
  43.   gimage = pdb_id_to_image (args[0].value.pdb_int);
  44.   if (gimage == NULL)
  45.     success = FALSE;
  46.  
  47.   if (success)
  48.     undo_push_group_start (gimage, MISC_UNDO);
  49.  
  50.   return procedural_db_return_args (&undo_push_group_start_proc, success);
  51. }
  52.  
  53. static ProcArg undo_push_group_start_inargs[] =
  54. {
  55.   {
  56.     PDB_IMAGE,
  57.     "image",
  58.     "The ID of the image in which to pop an undo group"
  59.   }
  60. };
  61.  
  62. static ProcRecord undo_push_group_start_proc =
  63. {
  64.   "gimp_undo_push_group_start",
  65.   "Starts a group undo.",
  66.   "This function is used to start a group undo--necessary for logically combining two or more undo operations into a single operation. This call must be used in conjunction with a 'gimp-undo-push-group-end' call.",
  67.   "Spencer Kimball & Peter Mattis",
  68.   "Spencer Kimball & Peter Mattis",
  69.   "1997",
  70.   PDB_INTERNAL,
  71.   1,
  72.   undo_push_group_start_inargs,
  73.   0,
  74.   NULL,
  75.   { { undo_push_group_start_invoker } }
  76. };
  77.  
  78. static Argument *
  79. undo_push_group_end_invoker (Argument *args)
  80. {
  81.   gboolean success = TRUE;
  82.   GimpImage *gimage;
  83.  
  84.   gimage = pdb_id_to_image (args[0].value.pdb_int);
  85.   if (gimage == NULL)
  86.     success = FALSE;
  87.  
  88.   if (success)
  89.     undo_push_group_end (gimage);
  90.  
  91.   return procedural_db_return_args (&undo_push_group_end_proc, success);
  92. }
  93.  
  94. static ProcArg undo_push_group_end_inargs[] =
  95. {
  96.   {
  97.     PDB_IMAGE,
  98.     "image",
  99.     "The ID of the image in which to pop an undo group"
  100.   }
  101. };
  102.  
  103. static ProcRecord undo_push_group_end_proc =
  104. {
  105.   "gimp_undo_push_group_end",
  106.   "Finish a group undo.",
  107.   "This function must be called once for each gimp-undo-push-group call that is made.",
  108.   "Spencer Kimball & Peter Mattis",
  109.   "Spencer Kimball & Peter Mattis",
  110.   "1997",
  111.   PDB_INTERNAL,
  112.   1,
  113.   undo_push_group_end_inargs,
  114.   0,
  115.   NULL,
  116.   { { undo_push_group_end_invoker } }
  117. };
  118.